﻿using System;
using SharpSqlAnalyzer.nodes;

namespace SharpSqlAnalyzer.stmt.db2
{
	// Token: 0x020001E4 RID: 484
	public class TDb2ReturnStmt : TCustomDb2Stmt
	{
		// Token: 0x06001051 RID: 4177 RVA: 0x0030CCF6 File Offset: 0x0030AEF6
		public TDb2ReturnStmt(EDbVendor dbvendor) : base(dbvendor)
		{
			this.sqlstatementtype = ESqlStatementType.sstdb2returnstmt;
		}

		// Token: 0x06001052 RID: 4178 RVA: 0x0030CD0A File Offset: 0x0030AF0A
		internal override void buildsql()
		{
		}

		// Token: 0x06001053 RID: 4179 RVA: 0x0030CD0C File Offset: 0x0030AF0C
		internal override void clear()
		{
		}

		// Token: 0x06001054 RID: 4180 RVA: 0x0030CD0E File Offset: 0x0030AF0E
		internal override string getasprettytext()
		{
			return "";
		}

		// Token: 0x06001055 RID: 4181 RVA: 0x0030CD15 File Offset: 0x0030AF15
		internal override void iterate(TVisitorAbs pvisitor)
		{
		}

		// Token: 0x06001056 RID: 4182 RVA: 0x0030CD18 File Offset: 0x0030AF18
		public override int doParseStatement(TCustomSqlStatement psql)
		{
			if (this.rootNode == null)
			{
				return -1;
			}
			TReturnSqlNode treturnSqlNode = (TReturnSqlNode)this.rootNode;
			base.doParseStatement(psql);
			if (treturnSqlNode.Expr != null)
			{
				this.returnExpr = treturnSqlNode.Expr;
			}
			if (treturnSqlNode.SelectSqlNode != null)
			{
				this.subquery = new TSelectSqlStatement(this.dbvendor);
				this.subquery.rootNode = treturnSqlNode.SelectSqlNode;
				this.subquery.doParseStatement(this);
			}
			return 0;
		}

		// Token: 0x17000303 RID: 771
		// (get) Token: 0x06001057 RID: 4183 RVA: 0x0030CD8F File Offset: 0x0030AF8F
		// (set) Token: 0x06001058 RID: 4184 RVA: 0x0030CD97 File Offset: 0x0030AF97
		public virtual TExpression ReturnExpr
		{
			get
			{
				return this.returnExpr;
			}
			set
			{
				this.returnExpr = value;
			}
		}

		// Token: 0x17000304 RID: 772
		// (get) Token: 0x06001059 RID: 4185 RVA: 0x0030CDA0 File Offset: 0x0030AFA0
		// (set) Token: 0x0600105A RID: 4186 RVA: 0x0030CDA8 File Offset: 0x0030AFA8
		public virtual TSelectSqlStatement Subquery
		{
			get
			{
				return this.subquery;
			}
			set
			{
				this.subquery = value;
			}
		}

		// Token: 0x0600105B RID: 4187 RVA: 0x0030CDB1 File Offset: 0x0030AFB1
		public override void accept(TParseTreeVisitor v)
		{
			v.preVisit(this);
			if (this.returnExpr != null)
			{
				this.returnExpr.accept(v);
			}
			if (this.subquery != null)
			{
				this.subquery.accept(v);
			}
			v.postVisit(this);
		}

		// Token: 0x04001392 RID: 5010
		private TExpression returnExpr;

		// Token: 0x04001393 RID: 5011
		private TSelectSqlStatement subquery;
	}
}
